package com.game.springbootstart.mapper;

import com.game.springbootstart.entity.CommentLikes;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-03-17
 */
@Mapper
public interface CommentLikesMapper extends BaseMapper<CommentLikes> {

    @Select("SELECT COUNT(*) FROM comment_likes WHERE comment_id = #{commentId} AND user_id = #{userId}")
    int checkIfLiked(@Param("commentId") Long commentId, @Param("userId") Long userId);
}
